﻿package demo.util {

	/**
	 * @author sshc625
	 */
	public class Delegate {
		/**
		 * @usage
		 * var f:Function = com.sshc625.utils.Delegate.create(owner.eventHandler, ...args);
		 * dispatcher.addEventListener(eventName, f);
		 *
		 * @parameter	handler	observer.
		 * @return		function
		 */
		public static function create(handler:Function, ... args):Function {
			return function(... innerArgs):* {
				return handler.apply(this, innerArgs.concat(args));
			}
		}
	}
}

